package sta01;

public class test {
    public static void main(String[] args) {
        //创建三个学生对象
        Student s1 = new Student();
        s1.setName("小明");
        s1.setAge(23);
        Student s2 = new Student();
        s2.setName("小红");
        s2.setAge(23);
        Student s3 = new Student();
        s3.setName("小刚");
        s3.setAge(23);
        //创建一个老师对象
        Teacher t1 = new Teacher();
        t1.setName("王老师");
        t1.setAge(45);
        //创建一个管理员对象
        Administrator a1 = new Administrator();
        a1.setName("李管理员");
        a1.setAge(23);
        //传递方法
        register(s1);
        register(s2);
        register(s3);
        register(t1);
        register(a1);

    }
    //这个方法能接受老师，也能接受学生,还能接受管理员
    public static void register(Person p) {
        p.show();

    }
}
